﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using ServiceCore.Entity.Core;
using ServiceCore.Entity.Model;
using ServiceCore.Entity.Param;
using ServiceCore.Entity.Param.Map;
using ServiceCore.Service;
using ServiceCore.WebApi.jwt;

namespace ServiceCore.WebApi.Controllers
{
    /// <summary>
    /// 映射
    /// </summary>
    [Route("Api/[controller]/[action]")]
    [ApiController]
    public class MapController : ApiJwtController
    {
        private MapService mapService = new MapService();

        /// <summary>
        /// 列表
        /// </summary>
        /// <arg name="arg"></arg>
        /// <returns></returns>
        [HttpPost]
        public BaseParam<MapInfo, List<MapInfo>> List(BaseParam<MapInfo, List<MapInfo>> arg)
        {
            arg = mapService.Map_List(arg);

            return arg;
        }

        /// <summary>
        /// 批量保存
        /// </summary>
        /// <arg name="arg"></arg>
        /// <returns></returns>
        [HttpPost]
        public BaseParam<List<MapInfo>, long> SaveList(BaseParam<List<MapInfo>, long> arg)
        {
            arg = mapService.Map_SaveList(arg);

            return arg;
        }

        /// <summary>
        /// 批量删除
        /// </summary>
        /// <arg name="arg"></arg>
        /// <returns></returns>
        [HttpPost]
        public BaseParam<IdsParam, long> DeleteList(BaseParam<IdsParam, long> arg)
        {
            arg = mapService.Map_DeleteList(arg);

            return arg;
        }


        /// <summary>
        /// 列表
        /// </summary>
        /// <arg name="arg"></arg>
        /// <returns></returns>
        [HttpPost]
        public BaseParam<MapTagParam, MapTagParam> TagTypeList(BaseParam<MapTagParam, MapTagParam> arg)
        {
            arg = mapService.Map_TagType_List(arg);

            return arg;
        }
        /// <summary>
        /// 保存
        /// </summary>
        /// <arg name="arg"></arg>
        /// <returns></returns>
        [HttpPost]
        public BaseParam<MapTagParam, int> TagTypeSave(BaseParam<MapTagParam, int> arg)
        {
            arg = mapService.Map_TagType_Save(arg);

            return arg;
        }


        /// <summary>
        /// 列表
        /// </summary>
        /// <arg name="arg"></arg>
        /// <returns></returns>
        [HttpPost]
        public BaseParam<MapTagParam, MapTagParam> TagList(BaseParam<MapTagParam, MapTagParam> arg)
        {
            arg = mapService.Map_Tag_List(arg);

            return arg;
        }
        
    }
}
